payload = {"username":"allen","password":"123456"}

# value = payload["aaa"]

# data = "username=allen&password=123456"
# data = "id=1"
# d1 = {}
# list1 = data.split('&')
# print(list1) # ["id=1"]
# # print(list1)
# # print(type(list1))
# for str1 in list1:
#     # print(str1)
#     # print(type(str1))
#     index = str1.find('=')
#     key = str1[:index]
#     value = str1[index+1:]
#     d1[key] = value
# print(data)
# print(d1)

d2= {'token': 'dc27d7ab192c4a7a8b52a0da94fbb34e', 'id': '1'}

# str1 = "id={id}"
# str1 = "{token}"
str1 = "username=allen&password=123456"
for key in d2.keys(): # {token}  id   {id}
    str1 = str1.replace('{'+key+'}',d2[key])

print(str1)